Adapting Big-Step Semantics to Small-Step Style: Coinductive Interpretations and "Higher-Order" Derivations
نویسندگان
چکیده
We adapt Kahn-style (\big-step") natural semantics to take on desirable aspects of small-step and denotational semantics forms, more precisely: (i) the ability to express divergent computations; (ii) the ability to reason about the (length of a) computation of a derivation; and (iii) the ability to compute upon and reason about higher-order values. To accomplish these results, we extend the classical, inductive interpretation of natural semantics with coinduction mechanisms and use \negative" rules to express divergence. A simple reformatting of the syntax of derivations allows a simple description of the \length" of a derivation. Finally, the recoding of closure values into denotational-semantics-like functions lets one embed derivations within closures that embed within derivations; in this sense, the semantics becomes \higher order." Examples are given to support the deenitional developments. Kahn-style (\big-step") natural semantics 9] captures a program's entire computation within a single derivation. This representation is more compact than what one obtains from state-transition, \small-step," and denotational deenitions; in addition, natural semantics provides several additional attractions: When the natural semantics is deened in \environment form," that is, the semantics' propositions are ternary relations of the form, ` e + v, where 2 Environment, e 2 Expression, and v 2 Value, the resulting derivations are (almost always) semi-compositional. That is, when one draws a physical derivation tree starting from an initial source program e 0 and initial (empty) environment 0 , then every node within the tree has the form 0 ` e 0 + v 0 , where e 0 is a subphrase of e 0. See Figure 1 for an example. One can prove concisely properties of convergent derivations by induction on the height of the derivation tree. Static analyses are simple to formalize. The key concept, a program's collecting semantics 2, 13, 15], is deened as a simple function of the program's derivation: Given a
منابع مشابه
Partial Evaluation of Higher-Order Natural-Semantics Derivations
We use on-line partial-evaluation technology to generate partial derivations from natural (big-step) semantics deenitions. First, we reformat the big-step rules into a small-step form, and we extend big-step semantics to be higher-order, that is, we allow data structures like closures to contain partial derivations. Next, we apply a supercompilation algorithm to the transformed semantics, there...
متن کاملCoinductive Big-Step Operational Semantics
Using a call-by-value functional language as an example, this article illustrates the use of coinductive definitions and proofs in big-step operational semantics, enabling it to describe diverging evaluations in addition to terminating evaluations. We formalize the connections between the coinductive big-step semantics and the standard small-step semantics, proving that both semantics are equiv...
متن کاملTrace-Based Coinductive Operational Semantics for While Big-Step and Small-Step, Relational and Functional Styles
We present four coinductive operational semantics for the While language accounting for both terminating and non-terminating program runs: big-step and small-step relational semantics and big-step and small-step functional semantics. The semantics employ traces (possibly infinite sequences of states) to record the states that program runs go through. The relational semantics relate statement-st...
متن کاملSoundness of Object-Oriented Languages with Coinductive Big-Step Semantics
It is well known that big-step operational semantics are not suitable for proving soundness of type systems, because of their inability to distinguish stuck from non-terminating computations. We show how this problem can be solved by interpreting coinductively the rules for the standard big-step operational semantics of a Java-like language, thus making the claim of soundness more intuitive: wh...
متن کاملInductive and Coinductive Techniques in the Operational Analysis of Functional Programs: an Introduction
Many works have shown that operational semantics is a useful framework for the formal study of programs properties. Our investigation takes as object of study a call-by-name variant of FPC, a functional language with higher order functions and recursive types. We show that by using Plotkin’s structural operational semantics it is possible to specify formal semantics for FPC for both convergent ...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید
ثبت ناماگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید
ورودعنوان ژورنال:
- Electr. Notes Theor. Comput. Sci.
دوره 10 شماره
صفحات -
تاریخ انتشار 1997